package com.lotto.manager.admin.init;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.lotto.manager.admin.daemon.KitheDaemon;
import com.lotto.manager.admin.service.AstrictService;
import com.lotto.manager.admin.service.GameService;
import com.lotto.manager.admin.service.KitheService;
import com.lotto.manager.admin.service.OddsService;
import com.lotto.manager.admin.service.SysConfigService;


/**
 * @author ltj 节点系统初始化类
 */
@Component
public class SystemMgr {
	private Logger logger = Logger.getLogger(SystemMgr.class);
	
	@Autowired
	private GameService gameService;
	
	@Autowired
	private AstrictService astrictService;
	
	@Autowired
	private OddsService oddsService;
	
	@Autowired
	private SysConfigService sysConfigService;
	
	
	
	/**
	 * Daemons
	 */
	
	
	@Autowired
	private KitheDaemon kitheDaemon;
	
	/**
	 * 初始化的数据
	 */
	@PostConstruct
	public void init() {
		initDatas();
		initDaemon();
	}

	


	/**
	 * 初始化的数据
	 */
	private void initDatas() {
		//gameService.initGame();
		//oddsService.initOdds();
		sysConfigService.init();
		
	}
	
	private void initDaemon(){
		kitheDaemon.start();
	}
	
	/**
	 * 销毁系统级别的资源
	 */
	@PreDestroy
	public void destroy() {
	}

}
